<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateSidebarsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('sidebars', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->comment('名称');
            $table->string('url')->nullable()->comment('对应跳转链接');
            $table->string('icon')->nullable()->comment('菜单对应的图标');
            $table->tinyInteger('sort')->default(1)->comment('排序');
            $table->tinyInteger('show_length')->default(1)->comment('显示长度');
            $table->string('active_names')->nullable()->comment('高亮数组');
            $table->integer('pid')->default(0)->comment('父菜单id');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('sidebars');
    }
}
